public class test2 {
    public static void main(String[] args) {
        //把整数的放进数组
        //反向推导

        //1 计算出数组的长度
        int number = 12345;
        //中间变量
        int temp = number;
        //计数器
        int count = 0;
        while (number != 0) {
            number = number / 10;
            count++;
        }

        //定义新数组
        int[] arr = new int[count];
        //数组索引
        int index = arr.length - 1;
        //放入数字进入数组
        while (temp != 0) {
            int ge = temp % 10;
            temp = temp / 10;
            arr[index] = ge;
            index--;
        }
        //输出
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i] + " ");
        }

    }
}
